package com.linkgie.galaxyframework.security.ca;

import com.linkgie.galaxyframework.crypto.Crypto;
import com.linkgie.galaxyframework.crypto.PublicKey;
import com.linkgie.galaxyframework.utils.StringConverter;

public class PublicKeyConverter implements StringConverter<PublicKey>{

    @Override
    public String encode(PublicKey value) {
        return value.getEncodedString();
    }

    @Override
    public PublicKey decode(String stringValue) {
        return Crypto.decode(stringValue, PublicKey.class);
    }
   
}
